import java.util.Random;

import at.fhhagenberg.se.tjr.protocol.CheckTrafficJam;

import com.sentilla.net.BroadcastAddress;
import com.sentilla.net.Sender;
import com.sentilla.net.SenderDriver;


public class SenderThread extends Thread{

	public void run(){
		Sender	sender = SenderDriver.create(new BroadcastAddress(), "local");
		Random random = new Random();
		
		while (true){
			CheckTrafficJam msg = new CheckTrafficJam(random.nextLong());
			sender.send(msg);
			try {
				Thread.sleep(2000);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
}
